import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;

public class NP0048小码哥的数对 {

    /**
     * 哈希
     *
     * @param args
     */
    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);
        // code here
        int n = input.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = input.nextInt();
        }
        int ans = 0;
        HashSet<Integer> numbers = new HashSet<>();
        for (int i : a) {
            if (i > 0) {
                numbers.add(i);
            }
        }
        for (int i : a) {
            if (i < 0) {
                if (numbers.contains(-i)) {
                    ans++;
                }
            }
        }

        System.out.println(ans);
        input.close();
    }

    /**
     * 双指针
     * @param args
     */
/*    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);
        // code here
        int n = input.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = input.nextInt();
        }
        Arrays.sort(a);
        int ans = 0, left = 0, right = a.length - 1;
        while (left < right) {
            long sum = a[left] + a[right];
            if (sum == 0) {
                ans++;
                left++;
                right--;
            } else if (sum < 0) {
                left++;
            } else {// sum > 0
                right--;
            }
        }
        System.out.println(ans);
        input.close();
    }*/
}
